package com.sunshine.simplehospital.bean

import androidx.room.*

/**
 * Created by sunshine on 2020/4/28
 */

@Dao
interface SimpleHospitalDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insertUser(vararg user: User)

    @Insert
    fun insertRegister(vararg register: Register)

    @Update
    fun updateUser(vararg user: User)

    @Update
    fun updateRegister(vararg register: Register)

    @Delete
    fun deleteUser(vararg user: User)

    @Delete
    fun deleteRegister(vararg register: Register)

    @get:Query("SELECT * FROM User")
    val allUser: List<User>

    @Query("SELECT * FROM Register WHERE userId = :userId")
    fun userRegister(userId: String): List<Register>

    @Query("SELECT * FROM USER WHERE userId = :userId")
    fun getUser(userId: String): List<User>?
}